Package

Source Code of Lab5Ex2

// Derek Neil
// Lab 5 Ex2

import java.util.Scanner;
public class Lab5Ex2{
  public static void main(String[] args){
    Scanner keyboard = new Scanner(System.in);
    System.out.print("Please input the first double ");
    double n1 = keyboard.nextDouble();
    System.out.print("Please input the second double ");
    double n2 = keyboard.nextDouble();
    System.out.print("Please input the third double ");
    double n3 = keyboard.nextDouble();
    System.out.print("The sum of "+ n1 + " and " + n2 + " is " + (n1+n2) + " which is");
    if ( n1+n2 <= n3) {
      System.out.print(" not");
      }
    System.out.print(" greater than "+ n3 );
  }
}




TOP

Related Classes of Lab5Ex2

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.